package com.zsr.controller;

import com.zsr.mapper.UserMapper;
import com.zsr.pojo.Users;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author zsr
 * @Desc
 * @Date 2021/5/21 16:10
 */
@RestController
public class UserController {
    @Autowired
    private UserMapper userMapper;

    @GetMapping("/queryUserList")
    public List<Users> queryUserList(){
        List<Users> users = userMapper.queryUserList();
        return users;

    }
    @GetMapping("/queryUserById/{id}")
    public Users queryUserById(@PathVariable("id") int id){
        Users users = userMapper.queryUserById(id);
        return users;

    }
}
